<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      console.log(Number("abc")); // NaN ×
      console.log(Number("hello")); // NaN ×
      console.log(Number("123")); //有效数字 √
      console.log(Number(" 123 ")); // 有效数字 √
      console.log(Number("0")); // 有效数字 √
      console.log(Number(" 1 23 ")); // 无效数字  NaN ×
      console.log(Number("")); //空字符串 √
      console.log(Number("     ")); //空格字符串 √
      console.log(Number(null)); // 0 √
      console.log(Number(true)); // 1 √
      console.log(Number(false)); // 0 √
    </script>
  </body>
</html>
